package com.yan.file;

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;

public class FileDemo2 {
    public static void main(String[] args) {
        File file1 = new File("D:\\IdeaProject\\javaSE-Plus\\day05_code\\src\\com\\yan\\file\\User");
        File file2 = new File("day05_code/src/com/yan/file/User");
        System.out.println(file1.length());
        System.out.println(file1.getName());
        System.out.println(file1.getPath());
        System.out.println(file2.getPath());
        System.out.println(file1.getAbsolutePath());
        long l = file2.lastModified();
        Date date = new Date(l);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
        System.out.println(sdf.format(date));
    }
}
